|
|
|
|
|
|
|
Control Panel is used. The fourth parameter is another tri-state value that determines whether to use parentheses to signify a negative value. The fifth parameter is a tri-state value specifying the use of grouping values for values over 1,000. A grouping value is a comma (,) or a decimal (.) or any other value thats specified in your regional settings in Control Panel. |
|
|
|
|
|
|
|
|
If you need to have a date returned in different formats, you can use the FormatDateTime() function. There are five different constants you can pass to this function to format the output of the date/time value. The constants are shown in the following output: |
|
|
|
 |
|
|
|
|
FormatDateTime(Now, [Constant])
vbGeneralDate = 10/26/98 7:38:07 PM
vbLongDate = Monday, October 26, 1998
vbLongTime = 7:38:07 PM
vbShortDate = 10/26/98
vbShortTime = 19:38 |
|
|
|
|
|
|
|
|
You only pass two parameters to this functionthe date expression and the constant specifying the type of date or time you want to output. |
|
|
|
|
|
|
|
|
FormatNumber() is exactly like the FormatCurrency() function, without the currency symbol. All the parameters are exactly the same: |
|
|
|
 |
|
|
|
|
FormatNumber(100) = 100.00
FormatNumber(100,4) = 100.0000
FormatNumber(.1,-1,vbFalse) = .10
FormatNumber(.1,-1,vbFalse) = 0.10
FormatNumber(-100,-1, , vbFalse) = (100.00)
FormatNumber(-100,-1, , vbUseDefault) = -100.00
FormatNumber(1,100,-1, , ,vbFalse) = 1100.00
FormatNumber(1,100,-1, , , vbUseDefault) = 1,100.00 |
|
|
|
|
|